package com.kun.example.rpc;

import java.lang.reflect.Proxy;

/**
 * @author 小K
 * @date 2022/4/9 0009 - 下午 15:43
 */
public class RpcProxyClient {

    public <T> T clientProxy(final Class<T> interfaceCls, final String host, final int port){

        return (T) Proxy.newProxyInstance(interfaceCls.getClassLoader(), new Class<?>[]{interfaceCls},new RemoteInvocationHandler(host,port));

    }
}
